<!DOCTYPE html>
<html>
<head>
	<title>MUKEFILE上传文件</title>

	<#include "common/headFile.ftl"/>

	<script type="text/javascript">
		$(function(){
			$("#fmm").submit(function(){
				var f2 = document.getElementById("file").value;
				if(f2.length===0){
					new $.zui.Messager('请选择您要上传的文件！', {
				       	icon: 'cloud-upload',// 定义消息图标
				       	type: 'warning',
				       	time:'1000'
				   	}).show();
					return false;
				}else{	//文件不为空
					var f1 = document.getElementById("file").files[0].size;
					if($("#size").val()<f1){
						new $.zui.Messager('您上传的文件大于可用空间，请重新上传文件！', {
				        	icon: 'cloud-upload',// 定义消息图标
				        	type: 'warning',
				        	time:'1000'
				    	}).show();
						return false;
					}else if (f1>104857600){
						new $.zui.Messager('您上传的文件大于100MB，请重新上传文件！', {
							icon: 'cloud-upload',// 定义消息图标
							type: 'warning',
							time:'1000'
						}).show();
						return false;
					}
				}
			})
		});
	</script>
</head>
<body>
	<div class="main">

		<#include "common/top.ftl"/>

		<div class="main-middle">

			<#include "common/leftMenu.ftl"/>

			<div class="main-middle-right">
				<div class="main-middle-right-top">
				   <div class="upload"><a href="upload">
					<button class="btn btn-primary" type="button" id="upload">
						<i class="icon-cloud-upload"></i> 文件上传</button></a>
				   </div>
					<div style="width: 300px; float: left; padding-left: 20px;">
						<span style="color: red;font-weight: bold;font-size: 16px; line-height: 56px;">
							<i>请上传小于100MB的文件</i></span>
					</div>
				   <div class="file-search">
					
				   </div>
				</div>
				<div class="main-middle-right-content">
					<div class="fileupload">
						<form action="mukeFile!upload" method="post" enctype="multipart/form-data" id="fmm">
							<input type="hidden" name="size" value="${user.diskAvail!}" id="size"/>
							<div class="file">
								<input type="file" name="file" id="file"/>
								<i style="color:red;font-size: 18px;">${msg! }</i>
							</div>
							<div class="file-submit">
								<input type="submit" value="上传" />
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

		<#include "common/bottom.ftl"/>
	</div>
</body>
</html>